import Vue from 'vue'
import Router from 'vue-router'
import index from '@/view/index'
import userManager from '@/view/userManager'
import xm from '@/view/xm'
import login from '@/view/login'
import register from '@/view/register'
import index2 from '@/view/index2'
import xmlogin from '@/view/xmlogin'
import goodsdetails from '@/view/goodsdetails'
import shopcar from '@/view/shopcar'

Vue.use(Router)

export default new Router({
  mode:"history",
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path:'/userManager',
      name:'userManager',
      component: userManager,
      children:[
        {
          path:'/login',
          name:'login',
          component:login
        },
        {
          path:'/register',
          name:'register',
          component:register
        }
      ]
    },
    {
      path:'/xm',
      name:'xm',
      component: xm
    },
    {
      path:'/xmlogin',
      name:'xmlogin',
      component: xmlogin
    },
    {
      path:'/goodsdetails',
      name:'goodsdetails',
      component: goodsdetails
    },
    {
      path:'/shopcar',
      name:'shopcar',
      component: shopcar
    },
    {
      path:'/userManager/:id/:name',
      name:'userManager1',
      component: userManager
    },
    {
      path:'/index2',
      name:'index2',
      component:index2,
      children:[
        {
          path:'/login1',
          name:'login1',
          component:login
        },
        {
          path:'/register1',
          name:'register1',
          component:register
        }
      ]
    }
  ]
})
